package com.njust.RateMyTray_backend.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njust.RateMyTray_backend.entity.Window;
import com.njust.RateMyTray_backend.vo.PopularWindowVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WindowMapper extends BaseMapper<Window> {
    
    @Select("SELECT id as windowId, window_name as name, rating_count as popularityScore " +
            "FROM t_window " +
            "ORDER BY rating_count DESC " +
            "LIMIT 5")
    List<PopularWindowVO> findMostPopularWindows();
} 